<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript">
function validate(){
	if(form.username.value==""){
		alert("用户名不能为空");	
		return false;
	}
	if(form.username.value.indexOf(",")>-1||form.username.value.indexOf("，")>-1){
		alert("用户名不能包含逗号");	
		return false;
	}
	if(form.password.value==""){
		alert("密码不能为空");	
		return false;
	}
}
</script>
<title>登录</title>
</head>
<body>
<form action="login" method="post" onsubmit="return validate()" name="form">
用户名：<input type="text" name="username"><br>
密码：<input type="password" name="password"><br>
<input type="submit" value="登录">
<input type="button" value="注册" onclick="window.location.href='register.html';">
</form>
</body>
</html>